﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GovOfficeRegionList.aspx.cs" Inherits="SD.Web.Iteration1.Government.GovOfficeRegionList" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="ContentTitle" ContentPlaceHolderID="ContentTitle" runat="server">
    <script type="text/javascript" language="Javascript">
        function Confirm_Edit() {
            if (confirm("Do you want to make this Government Office Region active?") == true)
                return true;
            else
                return false;
        } 
    </script> 
    <h2>Gorvernment Office Region List</h2>
</asp:Content>

<asp:Content ID="Content" ContentPlaceHolderID="Content" runat="server">
    <div class="grid740 simplebox">
        <asp:UpdatePanel ID="UpdatePanelGovOfficeRegion" runat="server">
            <ContentTemplate>
                <div class="titleh">
                    <h3 class="sorting_range">
                        <asp:LinkButton ID="LinkButtonAll" runat="server" CssClass="hg-blue" CommandName="all" OnCommand="FilterByLetters_Command">All</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton09" runat="server" CommandName="09" OnCommand="FilterByLetters_Command">0-9</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonAE" runat="server" CommandName="ae" OnCommand="FilterByLetters_Command">A B C D E</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonFJ" runat="server" CommandName="fj" OnCommand="FilterByLetters_Command">F G H I J</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonKN" runat="server" CommandName="kn" OnCommand="FilterByLetters_Command">K L M N </asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonOR" runat="server" CommandName="or" OnCommand="FilterByLetters_Command">O P Q R</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonSV" runat="server" CommandName="sv" OnCommand="FilterByLetters_Command">S T U V</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonWZ" CssClass="last" runat="server" CommandName="wz"
                            OnCommand="FilterByLetters_Command">W X Y Z</asp:LinkButton>
                        <span class="right">
                            <a id="ctl00_Content_LinkButtonAll" class="hg-blue" style="margin:10px;" href="CreateGovOfficeRegion.aspx">Create</a>
                            <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                                OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
                        </span>
                        </h3>
                </div>
                <asp:GridView ID="GridViewGovOfficeRegion" CssClass="tablesorter" runat="server" AutoGenerateColumns="False"
                    DataSourceID="ObjectDataSourceGovOfficeRegion" AllowPaging="True" PageSize="15" AllowSorting="True" OnRowCreated="GridViewOrg_RowCreated">
                    <Columns>
                        <asp:TemplateField HeaderText="Name" SortExpression="GovOfficeRegionName"> 
                            <ItemTemplate> 
                                <asp:LinkButton ID="LinkButtonGORName" runat="server" CommandName='<%# Eval("GovOfficeRegionId") %>'  

                                    CommandArgument='<%#Eval("IsActive") %>' OnCommand="LinkButtonGORName_Command"

                                    Text='<%# Eval("GovOfficeRegionName") %>'></asp:LinkButton> 
                            </ItemTemplate> 
                            <HeaderStyle CssClass="header" Width="133px"/> 
                        </asp:TemplateField>

                        <asp:TemplateField HeaderText="Description" SortExpression="Description">
                            <ItemTemplate>
                                <%# SD.Commons.StringTools.Substring(Eval("Description"), 0, 50, true)%>
                                </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="&nbsp;&nbsp;&nbsp;County">
                            <ItemTemplate>
                                <%# string.Format("...") %></ItemTemplate>
                            <HeaderStyle ForeColor="#367DB3" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Is Active ?" SortExpression="IsActive">
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%#(bool) Eval("IsActive")? "Yes":"No" %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                        </asp:TemplateField>
                    </Columns>
                    <PagerSettings Mode="NextPreviousFirstLast" />
                    <PagerStyle CssClass="pagination_table" HorizontalAlign="Right"></PagerStyle>
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>

        <asp:ObjectDataSource ID="ObjectDataSourceGovOfficeRegion" runat="server" SelectMethod="GetList"
            TypeName="SD.Business.GovOfficeRegionBUS" OnSelecting="ObjectDataSourceGovOfficeRegion_Selecting"
            EnablePaging="true" SelectCountMethod="GetGovOfficeRegionsCount" StartRowIndexParameterName="startRowIndex"
            MaximumRowsParameterName="maxRows" SortParameterName="sortType">
            <SelectParameters>
                <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
</asp:Content>